<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@taglib prefix="mvc" uri="http://www.springframework.org/tags/form" %>
<%@taglib prefix="fmt" uri="http://www.springframework.org/tags" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>立项查询</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=10,chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
    <link rel="stylesheet" type="text/css" href="/lib/layui/layui/css/layui.css"/>
    <script type="text/javascript" src="/js/news/jquery-1.9.1.js"></script>
    <script src="/js/base/base.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../js/jquery/jquery.cookie.js"></script>
    <script src="/lib/jQuery-File-Upload-master/jquery.ui.widget.js" type="text/javascript" charset="utf-8"></script>
    <script src="/lib/jQuery-File-Upload-master/jquery.iframe-transport.js" type="text/javascript" charset="utf-8"></script>
    <script type="text/javascript" src="/lib/layui/layui/layui.js"></script>
    <script type="text/javascript" src="/lib/layui/layui/layui.all.js"></script>
</head>
<style>
    .cont{
        margin: 10px;
    }
    .item img {
        height: 40px;
    }
    .sear{
        background: #bfe8ff;
        height: 30px;
        text-align: center;
        line-height: 30px;
        font-size: 15px;
    }
    .btn {
        height: 30px;
        margin: 10px auto;
    }

    .btn button {
        float: right;
    }
    .share{
        width: calc(96% / 2);
        float: left;
    }
    .layui-inline{
        display: block;
    }
    .layui-form-label{
        width: 100px;
    }
    .layui-input-inline{
        width: 70% !important;
    }
</style>
<body>
<div class="cont">
    <div class="item">
        <img src="../img/yeji.png" alt="" style="margin: 0 5px 0 20px;"> <span
            style="font-size: 22px;display: inline-block;vertical-align: middle;">立项查询</span>
    </div>
    <hr class="layui-bg-blue">
    <div class="sear">
        项目查询
    </div>
    <div class="btn">
        <button type="button" class="layui-btn layui-btn-sm add" style="background: #2b7fe0;margin-left: 15px"><i
                class="layui-icon"></i>返回
        </button>
        <button type="button" class="layui-btn layui-btn-sm search" style="background: #2b7fe0"><i
                class="layui-icon layui-icon-search"></i>查询
        </button>
    </div>
    <div class="sear" style="text-align: left;">
        【查询条件】
    </div>
    <div>
        <form class="layui-form" action="" style="margin-top: 10px">
            <div class="layui-form-item">
                <div class="layui-inline share">
                    <label class="layui-form-label">申报计划名称:</label>
                    <div class="layui-input-inline">
                        <input type="text" name="planName" lay-verify="email" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-inline share">
                    <label class="layui-form-label">项目编号:</label>
                    <div class="layui-input-inline">
                        <input type="text" name="trOther" lay-verify="email" autocomplete="off" class="layui-input">
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-inline share">
                    <label class="layui-form-label">项目名称</label>
                    <div class="layui-input-inline inp">
                        <input type="tel" name="topicName" lay-verify="required|phone" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-inline share">
                    <label class="layui-form-label">立项日期:</label>
                    <div class="layui-input-inline">
                        <input type="text" name="trTime"  id="date1" lay-verify="email" autocomplete="off" class="layui-input">
                    </div>
                </div>
            </div>

        </form>
        <table class="layui-hide" id="test" lay-filter="test"></table>
    </div>
</div>
</body>
</html>
<script>
    layui.use(['table','form', 'layedit', 'laydate'], function(){
        var table = layui.table,
            form = layui.form,
            laydate = layui.laydate,
            layedit = layui.layedit;
        form.render()
        laydate.render({
            elem: '#date1',
            format: 'yyyy-MM-dd', //指定时间格式
            value: new Date(),
        });

        $('.search').click(function(){
            console.log($('input[name="planName"]').val())
            table.render({
                elem: '#test'
                , url: '/Recognize/getProjectList'
                ,where: {
                    planName: $('input[name="planName"]').val(),
                    trOther: $('input[name="trOther"]').val(),
                    topicName: $('input[name="topicName"]').val(),
                    trTimeStr: $('input[name="trTime"]').val(),
                    trType: 1,
                    trStatus: 2
                }
                , title: '用户数据表'
                , cols: [[
                    {type: 'checkbox', fixed: 'left'}
                    , {field: 'topicName', title: '项目名称',templet:function(d){
                            return d.rpmTopic.topicName
                        }}
                    , {field: 'planName', title: '申报计划名称',templet:function(d){
                            return d.rpmPlan.planName
                        }}
                    , {field: 'name', title: '项目成员',templet:function(d){
                            var rpmSignatures = d.rpmTopic.rpmSignatures;
                            var nameId = ''
                            if(rpmSignatures != undefined){
                                for(var i=0;i<rpmSignatures.length;i++){
                                    if(rpmSignatures[i].userName != ''){
                                        nameId += rpmSignatures[i].userName +',';
                                    }
                                }
                                return nameId;
                            }
                            return '';
                        }}
                    , { title: '负责人',templet:function(d){
                            return d.rpmTopic.userName;
                        }}
                    , { title: '专家1 评分',templet:function(d){
                            var scoreList = d.rpmTopic.scoreList;
                            if (scoreList != undefined && scoreList.length > 0 && scoreList[0] != undefined){
                                return scoreList[0].rsScore;
                            }
                            return '';
                        }}
                    , { title: '专家1 意见',templet:function(d){
                            var scoreList = d.rpmTopic.scoreList;

                            if (scoreList != undefined && scoreList.length > 0 && scoreList[0] != undefined){
                                return scoreList[0].remarks;
                            }
                            return '';
                        }}
                    , { title: '专家2 评分',templet:function(d){
                            var scoreList = d.rpmTopic.scoreList;

                            if (scoreList != undefined && scoreList.length > 0 && scoreList[1] != undefined){
                                return scoreList[1].rsScore;
                            }
                            return '';
                        }}
                    , { title: '专家2 意见',templet:function(d){
                            var scoreList = d.rpmTopic.scoreList;

                            if (scoreList != undefined && scoreList.length > 0 && scoreList[1] != undefined){
                                return scoreList[1].remarks;
                            }
                            return '';
                        }}
                    , { title: '专家3 评分',templet:function(d){
                            var scoreList = d.rpmTopic.scoreList;

                            if (scoreList != undefined && scoreList.length > 0 && scoreList[2] != undefined){
                                return scoreList[2].rsScore;
                            }
                            return '';
                        }}
                    , { title: '专家3 意见',templet:function(d){
                            var scoreList = d.rpmTopic.scoreList;

                            if (scoreList != undefined && scoreList.length > 0 && scoreList[2] != undefined){
                                return scoreList[2].remarks;
                            }
                            return '';
                        }}
                    , { title: '专家4 评分',templet:function(d){
                            var scoreList = d.rpmTopic.scoreList;

                            if (scoreList != undefined && scoreList.length > 0 && scoreList[3] != undefined){
                                return scoreList[3].rsScore;
                            }
                            return '';
                        }}
                    , { title: '专家4 意见',templet:function(d){
                            var scoreList = d.rpmTopic.scoreList;

                            if (scoreList != undefined && scoreList.length > 0 && scoreList[3] != undefined){
                                return scoreList[3].remarks;
                            }
                            return '';
                        }}
                    , { title: '平均分',templet:function(d){
                            var avg = d.rpmTopic.avg;
                            if (avg != undefined){
                                return avg;
                            }
                            return '';
                        }}
                ]]
                ,parseData:function(res){
                    return {
                        "code":0, //解析接口状态
                        "data": res.object //解析数据列表
                    };
                }
            })
        })




    })
</script>
